import React from 'react';
import { lazy } from 'react';
import { Navigate, RouteObject } from 'react-router-dom';
import { Layout } from '../components';
import LazyImport from '../components/LazyImport';
// import { Home, Subject, AticleDetail, SearchPage } from "../pages";
import Home from '../pages/home';
import Subject from '../pages/subject';
import SearchPage from '../pages/SearchPage';
import AticleDetail from '../pages/AticleDetail';
import  SubjectRecommand from '../pages/SubjectRecommand';

const routes = [
  {
    path: '/',
    element: <Navigate to="/subjectRecommad" replace={true} />,
  },
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/',
        element: <Home />,
        children: [
          {
            path: 'subjectRecommad', //后台
            element: <SubjectRecommand />,
          },
          {
            path: 'subjectList', //后台
            element: <Subject />,
          },
          {
            path: 'acticleDetail', //后台
            element: <AticleDetail />,
          },
          {
            path: 'searchPage', //后台
            element: <SearchPage />,
          },
        ]
      },
      
    ],
  },
];

export default routes;
